<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加异常通知人员</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/public/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/public/layuiadmin/style/admin.css" media="all">
    <script src="/public/js/selectIframe.js"></script>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div style="height: 42px;line-height: 42px;padding: 0 15px;border-bottom: 1px solid #f6f6f6;color: #333;border-radius: 2px 2px 0 0;font-size: 14px;">
            <span><i id="return" class="layui-icon layui-icon-return" style="padding-right: 10px;"></i></span>
            <span>添加异常通知人员</span>
        </div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="component-form-group">

                <div class="layui-form-item">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name"  autocomplete="off" placeholder="请输入名称" class="layui-input" lay-verify="required">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">手机号码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="mobile"  autocomplete="off" placeholder="请输入手机号码" class="layui-input" lay-verify="phone">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">关联站点</label>
                        <div class="layui-input-inline" style="width: 600px">
                            <input type="text" id="stationName" name="stationName" autocomplete="off" placeholder="请选择站点" class="layui-input">
                        </div>
                        <div class="layui-input-inline">
                            <input type="button" class="layui-btn layui-btn-normal layui-btn-radius" onclick="selectStation()" value="关联站点">
                        </div>
                        <input type="hidden" name="stationId" id="stationId" value="">
                    </div>
                </div>

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="/public/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/public/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','layer'], function(){
        var $ = layui.$
                ,layer = layui.layer
                ,form = layui.form;

        $(document).on('click','#return',function(){
            window.location.href = "/station/faultUserList";
        });

        /* 监听提交 */
        form.on('submit(component-form-demo1)', function(data){
            var data=data.field;

            $.post("/station/saveFaultUser", data, function (result) {
                if (result.code > 0) {
                    layer.msg(result.msg, {icon:2});
                } else {
                    window.location.href = "/station/faultUserList";
                }
            });
            return false;
        });
    });
</script>
</body>
</html>

